import requests
from bs4 import BeautifulSoup
import re

def getHtmlText(url):
    try:
        r = requests.get(url)
        r.raise_for_status()
        r.encoding = 'utf-8'
        return r.text
    except:
        return "error"

def FindHtmlText(text):
    suop = BeautifulSoup(text, "html.parser")
    return suop.find_all(string = re.compile('百度'))

url = "http://www.baidu.com"

text = getHtmlText(url)
myvalue = FindHtmlText(text)
print(myvalue)